﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Pixysoft.Framework.Configurations
{
    public interface IConfigurationCollection :
        IEnumerable<IConfiguration>, IEnumerator<IConfiguration>
    {
        /// <summary>
        /// 集合数据
        /// </summary>
        int Count { get;}

        /// <summary>
        /// 获取指定id的配置项
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        IConfiguration GetConfiguration(string id);

        /// <summary>
        /// 取得config
        /// </summary>
        /// <param name="id"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        IConfiguration GetConfiguration(string id, string name);

        /// <summary>
        /// 根据位置取得配置
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        IConfiguration GetConfiguration(int index);

        /// <summary>
        /// 是否包含对应的config
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool Contains(string id);

        /// <summary>
        /// 是否包含
        /// </summary>
        /// <param name="id"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        bool Contains(string id, string name);

        /// <summary>
        /// 添加配置项
        /// </summary>
        /// <param name="setting"></param>
        void Add(IConfiguration setting);
    }
}
